package devcken.datatables.serverside;

import java.util.HashMap;

import org.apache.commons.lang.StringUtils;

public class FromServer extends HashMap<String, Object>
{
	private static final long serialVersionUID = 8384970749113931525L;

	public Long getiTotalRecords()
	{
		if (this.containsKey("iTotalRecords"))
		{
			return (Long)this.get("iTotalRecords");
		}
		else
		{
			return 0L;
		}
	}

	public int getiTotalDisplayRecords()
	{
		if (this.containsKey("iTotalDisplayRecords"))
		{
			return (int)this.get("iTotalDisplayRecords");
		}
		else
		{
			return 0;
		}
	}

	public String getsEcho()
	{
		if (this.containsKey("sEcho"))
		{
			return this.get("sEcho").toString();
		}
		else
		{
			return StringUtils.EMPTY;
		}
	}

	public String getsColumns()
	{
		if (this.containsKey("sColumns"))
		{
			return this.get("sColumns").toString();
		}
		else
		{
			return StringUtils.EMPTY;
		}
	}

	public Object[] getAaData()
	{
		if (this.containsKey("aaData"))
		{
			return (Object[])this.get("aaData");
		}
		else
		{
			return null;
		}
	}

	public void setiTotalRecords(Long iTotalRecords)
	{
		this.put("iTotalRecords", iTotalRecords);
	}

	public void setiTotalDisplayRecords(int iTotalDisplayRecords)
	{
		this.put("iTotalDisplayRecords", iTotalDisplayRecords);
	}

	public void setsEcho(String sEcho)
	{
		this.put("sEcho", sEcho);
	}

	public void setsColumns(String sColumns)
	{
		this.put("sColumns", sColumns);
	}

	public void setAaData(Object[] aaData)
	{
		this.put("aaData", aaData);
	}
}